import Ux from "ux";
import {Col, Icon, Statistic, Table} from "antd";
import React from "react";
import {G2Bar} from "ei";

export default {
    renderBar: (reference) => {
        const {$ciAss = {}} = reference.state;
        const {config = {}, data = []} = $ciAss;
        // 最大值计算
        config.scale = {
            value: {
                max: Ux.g2ScaleMax(data)
            }
        };
        // 内容呈现
        config.interval = {
            label: {
                content: (item) => item.value,
            }
        }
        config.legend = false;
        return (<G2Bar id={"user-hand"}
                       config={config}
                       data={data}
                       style={{
                           height: 180,
                       }}/>)
    }
}